<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    var userlist = ["zhangsan","lisi","wangwu"];
    /**
     * arr.shift() 
     * 删除数组的第一个元素，数组长度-1，
     * 返回值为被删除的数组元素
     */
    var result = userlist.shift();
    while(userlist.length > 0){
        userlist.shift();
    }
    //console.log(result);
    console.log(userlist);
    /**
     *arr.pop() 删除数组的最后一个元素 
     */

</script>
</html>